Copyright: M-Edit V2.0 (c)1992 Babarsoft


Contents
M-Edit: A Programmer's Editor for Windows NT Operating System

(c) 1992, 1993 Babarsoft, 3/30/93 by Mark Gamber

Version 2.3 for March Release

First Things First

Before You Begin

Overview

Displays

Menu Functions

File

Edit

Search

Options

Window

Build

Tools

Help

ShortCuts

Toolbar

Hotkeys

About M-Edit


Windows NT is a trademark of the Microsoft Corporation


About M-Edit Version 2.3

M-Edit is Copyright 1992,1993 Babarsoft.


Active Windows

Although several windows may be open at a time, only one window may be "active" at a time. This window stands out in two ways. First, it's title bar is the same color as that of the M-Edit main window's title bar and second, it's menu item in the "Window" menu is checked, while all others are not. Many of the functions in M-Edit use only the active window.


Context Sensitive Help

Help may be obtained for any subject covered by the help files specified in the "Help Setup" settings by positioning the cursor over a function/word of interest and pressing F1 or by clicking the right mouse button over the function/word. If the help system can find the subject, it is displayed by the help system


Toolbar


Current cursor position in active window.


Opens a file from disk.


Saves the currently active window contents to disk.


Loads a Workspace from disk.


Starts "Find Text" dialog box.


Copies selected text to the clipboard.


Cuts selected text from active window to the clipboard.


Pastes clipboard text into window at cursor position.


Tiles open windows vertically.


Tiles open windows horizontally.


Cascades open windows.


Jumps to a specified line, highlighting the line.


Starts compiler on active or selected window contents.


Starts Nmake build process on Make file.


Display color window to set window background color.


Display font window to set font, text color.


Starts an executable program.


Starts this online help.


Toolbox


Hotkeys

These key combinations carry out the following menu functions:

Control+F12	Open	Shift+F12	Save

Alt+F12	Save As	Alt+F4	Exit

Control+X	Cut	Control+C	Copy

Control+V	Paste	Control+Z	Undo

F3	Find	Shift+F3	Replace

F5	Go To	Shift+F4	Tile

Shift+F5	Cascade	Alt+C	Color

Alt+O	Fonts	Alt+T	Tab Stops

Alt+F1	M-Edit Help	F1	Language Help

Alt+V	Save Workspace	Alt+L	Load Workspace


Before You Begin

M-Edit was written with the developer in mind. It ties together many features of the Windows NT SDK, simplifying overall development and decreasing the amount of time required to get a project running. In order to fully use the editor, you must do a bit of preparation.

Certain environment variables need to be set in order for the compiler and linker to operate correctly. The Windows NT SDK provides a batch file, SETENV.BAT, which sets these variables for you. M-Edit also can cover that aspect by setting the "Environment" paths in the "Options" menu. Since this is only for Intel based machines, the CPU setting is "i386" by default and cannot be changed. When the compiler and linker are started by M-Edit, these variables are passed to them, eliminating the need for external batch support.

The path must include the compiler and linker executables if they are not in the same directory as M-Edit. You may change the path used by M-Edit in the "Environment" menu to include the compiler and linker. In addition, you must include the path for QH.EXE if you choose to use the Quick Help help system and set HELPFILES to point the the help files. For example:

C:\MSTOOLS\HELP\*.HLP  is a valid HELPFILES entry, assuming that's where you help files actually are.

Finally, M-Edit is based on a number of advanced features available only in Windows NT and should not be run under Windows 3.1 using the Win32s libraries. It will run, but not correctly and many features simply won't work or worse, won't work as expected. No attempt will be made to conform it to Win32s as it requires the advanced features to operate as intended.


Displays

Every attempt has been made to make M-Edit as easy to use as possible. Many of the features available in M-Edit may only be used if conditions warrant. Many menu options are not available if there is no active window and the toolbar buttons will not function. In addition, each window assigned a file displays the filename as the title bar. If the file is changed in any way, an asterisk precedes the actual filename, indicating that the file has been changed but not yet saved since the changes were made. Attempting to close the window, exit M-Edit or compile the file will result in a prompt asking if you are sure of the action you are about to take.

You may enter text using Insert or Overstrike mode. Insert mode may be distiguished by the small cursor, while Overstrike mode uses a cursor about the same width as the letters. Use the Insert key to toggle between modes.

Compiling and building applications using NMAKE may be done from within M-Edit by selecting the "Compile" and "Build" menu items. Output from the various tools is displayed in a listbox as the tools run. Below the listbox is an OK button which is not enabled until the process is complete, at which time you may close the dialog box if you so choose. Trouble with compiling and building is usually a result of improper Environment settings. Make sure the pathnames are correct if you experience difficulty.


Overview

M-Edit is a programmer's text editor for the Windows NT Operating System. Among it's many features are:

Multiple windows, each able to hold up to 256K of text.

Individiual window colors, font styles and text colors.

Context sensitive language help.

Workspace save and retrieval.

Direct access to most Windows NT SDK tools.

Compile and project Build options.

Toolbar or free-floating toolbox for common functions.

Alterable tab stop settings.

Currently, M-Edit is free and may be freely distributed, but it is not public domain. The application may not be disassembled or reverse engineered in any way. In using M-Edit, the user shall indemnify and hold harmless the software and author from damages arising in the use of M-Edit, whether real or imagined. In the user in unable to accept that stipulation, the software should be destroyed. The author may be contacted on the following services:

America Online E-Mail:	PCA MarkG

Compuserve Mail:	76450,2754

Internet Mail:	pcamarkg@aol.com

Note: Sorry, Internet file transfers are not available.


File Menu Overview
File Menu Functions

New

Open

Save

Save As

Save Workspace

Load Workspace

Exit:	Closes M-Edit.

Back


Edit Menu Overview
Edit Menu Functions

Cut

Copy

Paste

Undo

Back


Search Menu Overview
Search Menu Functions

Find

Replace

Go To

Options

Back


Window Menu Overview
Window Menu Functions

Tile

Cascade

Arrange Icons

Close All

Back


Option Menu Overview
Options Menu Functions

Background Color

Color

Font

Tab Stops

Environment

Compiler

Help Setup

Save Defaults

Back


Build Menu Overview
Build Menu Functions

Source Code

Compile

Build

Build All

Run Program

Windows Debugger

Dialog Editor

Image Editor

Hotspot Editor

Spy

Performance

Back


Help Menu Overview
Help Menu Functions

Help:	Displays this help file.

About:	Displays brief information on M-Edit.


Tool Menu Functions

Edit Menu

Back


Tool Menu - Edit Menu

Tools and utilities may be added to this menu by selecting Edit Menu, which displays a list of tools currently available. Highlight a name and press "Edit" to change the tool settings or press "Add" to insert a new entry. "Remove" takes out a highlighted item.


File Menu - Open Hex

Binary files, such as executables and data files, cannot be read using an ordinary text editor as many of the characters are undisplayable. In order to view and alter the contents of a binary file, a binary editor is available through the "Open Hex" menu item. When a file is opened, you are presented with the data in hexidecimal and ASCII form. Initially, editting is done in the hexidecimal section of the window, but you may toggle between that and the ASCII section using the ALT-H key.

The current byte to be editted is highlighted with a gray cursor. If in the hexidecimal section, you may type any hexidecimal key to edit the currently highlighted byte. In the ASCII section, pressing any valid key inserts the character into the current space.


File Menu - New

New creates a new window using the current font, tab stop and color settings. The window is titled "Untitled" until the contents are saved using "Save As". A file may NOT be saved using the name "Untitled".


File Menu - Open

Open loads a file from disk into a window. The window is displayed using the default font, tab stops and colors and is titled according to the name of the file loaded. The contents may be saved to the same file using "Save" or a new file using "Save As". Files up to 256K each may be opened using M-Edit.

Multiple files can be opened in a session, and multiple views of a single may be opened. If "Auto Update" is enabled, up to four windows may be opened to the same file and, when the contents of one is changed, the contents of the other three change automatically, including the need to save the views. Disabling "Auto Update" doesn't prevent multiple views of a file, but does prevent automatic updating.


File Open Window


File Menu - Save

Save writes the contents of the currently active window file to it's associated file. Save will automatically revert to "Save As" if the window is untitled and "Save" is used. Control passes to the window when the save is complete. When the text in a window has changed since it was opened or saved last (if at all), an asterisk precedes the actual file name, providing a visual cue that the file has been changed.


File Menu - Save As

Save As displays a prompt to enter a filename for the currently active window and, if OK is pressed, saves the contents of the currently active window to the file specified. The window title changes to reflect the change in file names. Control is passed to the active window when the save is complete. When the text in a window has changed since it was opened or saved last (if at all), an asterisk precedes the actual file name, providing a visual cue that the file has been changed.


File Save As Window


File Menu - Save Workspace

A "Workspace" may be saved for later retrieval using "Load Workspace". When the current workspace is saved, all windows currently open are added to a workspace file along with their background color, text style and color, size, position relative to the main window and the current tabstop setting. In addition, the main window size and position is saved. To save a workspace, select "Save Workspace" from the "File" menu and enter a valid filename. Press OK to save the workspace of Cancel to exit without saving.


File Menu - Load Workspace

Select "Load Workspace" from the "File" menu and choose a saved workspace file to open. Press OK to open the workspace file or Cancel to exit without change. Upon opening a workspace, all currently open windows are closed. Any modifyed files may be saved before they are closed. Loading a workspace causes M-Edit to load all the files listed in the workspace file, if found, and restores the size and position, background color, text style and color of each window opened. In addition, the main window is sized and positioned as saved in the workspace and the tabstops are changed.


Edit Menu - Cut

Selected text (highlighted) may be cut from the active window, removing it from the active window and placing the text into the clipboard for later pasting. You may reverse a mistake by selecting Undo. Cut is not active, nor is the toolbar button, if no text has been selected.


Edit Menu - Copy

Selected text (highlighted) may be copied from the active window to the clipboard, leaving the selected text intact as well as making it available for pasting from the clipboard. Copy is not active, nor is the toolbar button, if no text has been selected to copy.


Edit Menu - Paste

Clipboard text from any application may be pasted into the active window at the current location of the blinking cursor. A mistake may be reversed by selecting Undo. Paste is not active, nor is the toolbar button, if there is no text in the Clipboard to paste.


Edit Menu - Undo

Undo "moves back" a step, reversing the last action taken on the active window. If, for example, text was cut from the window, Undo places the text back where it came from. Likewise, a certain number of keystrokes may be eliminated through Undo. Undo is not active if nothing has happened that can be undone, or if the last action can't be undone for any reason.


Search Menu - Find

Find displays a prompt to enter a string of characters to search for and begins looking from the current cursor position for the string. The search is conducted in the currently active window and, if found, the text is highlighted. Otherwise, "Text not Found" appears in the information bar at the bottom of the window. Text may be replaced by using the Replace menu item. Find is not active, nor is the toolbar button, if there is no active window to find text in.

The dialog box used to enter text to find remains onscreen until it is explicitly closed. This enables you to find another item without the need to start over. You must first, however, move the cursor to a line to begin searching. If you have found an item which is currently highlighted and wish to find the next item, move the cursor down a line before restarting. Otherwise, it will simply highlight the same text again.


Search Menu - Options

Text search/replace may be carried out on the current window or all open windows, visible or minimized.


Find Window


Search Menu - Replace

Text in the active window may be found and replaced by entering the text to find, the text to replace it with and how to go about replacing the text. You may select from replacing the text each time found (or not) or replacing all text in the window without intervention.


Replace Window


Search Menu - Go To
Seach Menu - Go To

Go To causes the cursor and current position to jump to a line number in the currently active window. The line is entered using a dialog box entry and, if the line is larger than the actual number of lines in the box, it jumps to the last line in the window. The line specified is highlighted and scrolled into view.


Go To Window


Window Menu - Tile

Tile causes all displayed windows to rearrange in a tiled fashion. That is, the windows are resized so no window overlaps any other window. Windows reduced to icons are not affected by this operation. Also see "Cascade".


Window Menu - Cascade

Cascade forces all windows to a reasonable size within the main window, overlapping the windows from upper left to lower right. Cascading a single window will make it the size of the main window without maximizing the window. Windows reduced to icons are not affected by this operation. Also see "Tile"


Window Menu - Arrange Icons

Select this menu item when you have resized your main window so icons have disappeared from view in the window. The icons will reappear aligned at the bottom of the main window.


Window Menu - Close All

Close All closes all displayed windows and icons.


Options Menu - Color

Sets the background color for the currently active window. Selecting this menu item displays a dialog box of colors from which you may select one and press OK to accept the new background color or Cancel to exit without change.


Options Menu - Background
 Options Menu - Background Color

The main window may be assigned a background color by selecting this menu option. Select and color and press OK to change or Cancel to exit without change.


Color Selection Window


Options Menu - Font

Selecting the Font menu item displays a dialog box from which you may select the font type, size and text color. When you have made your selection, press OK to put it into effect with the active window or Cancel to exit without change.


Font Selection Window


Options Menu - Tab Stops

Tab Stops are the number of spaces to move to the right for each press of the Tab key. This number may be set from a dialog box and applied to all windows, not just the currently active window. Enter the number of characters to tab per keypress and press OK to accept the entry or Cancel to exit without change. In addition to tab stop settings, you may turn Automatic Indent on and off. Automatic Indent works by keeping track of the number of "{" and "}" keys typed and what precedes or follows the keys, automatically indenting the next line by a given number of tabs. To defeat the automatic indent temporarily, you may press Enter twice. Deselecting Automatic Indent disables it completely.


Tab Stops Window


Options Menu - Environment

Certain environment variables need to be correctly set for the Windows NT SDK compiler and linker to operate correctly. One, "CPU" is set to "i386" by default since M-Edit currently only supports Intel 386/486 based machines. "Include" must be set to point to the directory where the C header files (*.H) are stored and is set by default to "C:\MSTOOLS\H". The second, "Lib", points to the directory where linker libraries are stored and is set by default to "C:\MSTOOLS\LIB". In addition, "HELPFILES" points to the path and files that can be accessed by the Quick Help system. For example, "C:\MSTOOLS\HELP\*.HLP" is an acceptable setting. Finally, you can alter the path used by M-Edit and programs it runs, such as the SDK tools, compiler and linker, by changing the settings in the "Path" box.

When the Environment window is displayed, M-Edit checks for data in the following order:

1. M-Edit Initialization file. If not found:

2. Windows NT global environment settings. If not found:

3. Defaults as outlined above. Only Path has no default and must be explicitly set if incorrect.


Environment Window


Options Menu - Save Defaults

Selecting this menu item saves the current window color, font and tab stop settings. After saving, all new windows will have these attributes applied automatically when a new window is created by starting a new document or opening a file.


Build Menu - Compile

Compile starts the Windows NT SDK compiler, or any tool specified by the Tool Options setting. The file to be compiled is that which is in the currently active window or, if there are no active windows, you may select a file to compile from a list of available source files. Upon starting the compiler, a dialog box appears which displays output from the compiler as it works. Upon completion, "***   Operation Done  ***" will appear at the bottom of the text and the "OK" button will be enabled, allowing you to close the dialog box. It will remain onscreen until explicitly closed to provide error information while editting the file itself, making it easier to correct errors as they are found.


Build Menu - Build / Build All

Build starts NMAKE, a project management program shipped with the Windows NT SDK. NMAKE can operate only on files changed since it was last run (Build) or it can be forced to operate on all files relevant to the project (Build All). Output from the tools run by NMAKE is displayed in a dialog box as they work. The window remains onscreen until explicitly closed, making it easier to correct any errors found by the various tools. You may close the dialog box anytime after the "OK" button is enabled on the window and "***  Operation Done ***" appears in the window.


Options Menu - Compiler

Tool Options currently lets you select a command line for the compiler used by the Compile menu function, whether a prompt is displayed before starting the Compile or Build processes and if M-Edit should minimize itself when running one of the available Windows NT SDK tools.

The compiler command line should be exactly as you would type it from the command line, omitting the actual file to compile. For example:

cl386 -c -Od -Zi -Gs3 -DWIN32 -Di386  is an acceptable command line.


Compiler Window


Build Menu - SDK Tools
Build Menu - Windows NT SDK Tools

Various Windows NT SDK tools may be started from the Build menu for ease of use. When starting the WinDebug graphical debugger, you are first prompted for a program to debug as it is required by the debugger. All other tools are executed as soon as the item is seleted.


Build Menu - Source Code

M-Edit is capable of producing source code comprising a Windows executable or DLL library. Selecting "Source Code" displays a dialog box from which you may select the type of source to produce and which files to display including C or C++ source, include, resource, definition and make files. You may also specify the program name, window title and filename which are injected into each file, as required, automatically. These files can be compiled as-is into a simple Windows application or DLL, although it is up to you to add more functionality to them. Filenames should not include an extender as one is appended to the base name automatically depending on the file and type chosen. Note that selecting Application (C) produces a C file with standard C support files while selecting Application (CPP) produces a C++ file with it's own brand of support files. Window Title is disabled for a DLL library as such a program produces no window of it's own.


Source Code Window


Options Menu - Help Setup
Options - Help Setup

M-Edit can access help files for languages and the Windows SDK by pressing F1 or the right mouse button over a function/word of interest. In order to do this, you must tell M-Edit which help system to use: Windows Help or Quick Help. If you select Windows Help, you must also specify the filename to use as the help file. Quick Help relies on a system variable "HELPFILES" which must be included in the AUTOEXEC.NT file. For example:

HELPFILES=C:\MSTOOLS\HELP\*.HLP   will force Quick Help to search through any help files in the specified directory for the item you selected. In addition, if using Quick Help, you must add the path in which QH.EXE resides in order for it to run. You can do this by adding the pathname to the PATH statement in AUTOEXEC.NT.


Help Setup Window